//
//  WCNHomeBtn.m
//  WCN
//
//  Created by wsj2015 on 16/4/7.
//  Copyright © 2016年 ShanghaiCize Trade And Business Co., Ltd. All rights reserved.
//

#import "WCNHomeBtn.h"

@implementation WCNHomeBtn
{
    UIImageView *_leftImageView;
    UILabel *_label;
}


- (void)setFrame:(CGRect)frame
{
    [super setFrame:frame];
    
    
    _leftImageView =[UIImageView new];
    [self addSubview:_leftImageView];
    _label =[UILabel new];
//    _label.backgroundColor =[UIColor greenColor];
    [self addSubview:_label];
}
- (void)layoutSubviews
{
    CGFloat h =self.bounds.size.height;
    CGFloat w = self.bounds.size.width;
    CGFloat imageL = 0.64 * h;
    CGFloat labelW =75;
    _leftImageView.frame = CGRectMake((w-(imageL +8 +labelW ))/2, (h- imageL)/2, imageL, imageL) ;
    _label.frame = CGRectMake(CGRectGetMaxX(_leftImageView.frame)+8, h/2 -10, labelW, 20);
    
    

    [super layoutSubviews];
}
- (void)setTitle:(NSString *)title
{
    [_label setText:title];
}
- (void)setLeftImage:(UIImage *)leftImage{
    _leftImageView.image = leftImage;
}
@end
